﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace KlirProject.WP.LoginWP
{
    [ToolboxItemAttribute(false)]
    public class LoginWP : WebPart
    {

        #region toolpartproperies
        private string _RedirectUrl;
        [WebBrowsable(true),
        WebDisplayName("Name"),
        WebDescription("My Name"),
        Personalizable(PersonalizationScope.Shared),
        Category("Custom Property"),
        System.ComponentModel.DefaultValue("")]

        public string RedirectUrl
        {
            get { return _RedirectUrl; }
            set { _RedirectUrl = value; }
        }
        #endregion

        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/15/KlirProject.WP/LoginWP/LoginWPUserControl.ascx";

        protected override void CreateChildControls()
        {
            LoginWPUserControl control = (LoginWPUserControl)Page.LoadControl(_ascxPath);
            control.RedirectUrl = RedirectUrl;
            Controls.Add(control);
        }
    }
}
